package com.yeung.exam;

// 本题为考试单行多行输入输出规范示例，无需提交，不计分。

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class 计算绝对值 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] inputs = new String[2];
        inputs[0] = scanner.nextLine();
        inputs[1] = scanner.nextLine();
        String[] line = inputs[1].split(" ");
        int[] nums = new int[line.length];
        int index = 0;
        for (String s : line) {
            nums[index++] = Integer.valueOf(s);
        }
        //开始计算响铃两个数的绝对值
        Map<Integer, Integer> result = new HashMap<>();
        for (int i = 0; i < nums.length - 1; i++) {
            int pre = nums[i];
            int suf = nums[i + 1];
            result.put(i, Math.abs(pre - suf));
        }
        int minNum = Integer.MAX_VALUE;
        int minKey = -1;
        for (Map.Entry<Integer, Integer> entry : result.entrySet()) {
            if (entry.getValue() < minNum) {
                minNum = entry.getValue();
                minKey = entry.getKey();
            }
        }
        System.out.println(nums[minKey] + " " + nums[minKey + 1]);

    }
}
